package br.com.lambdacore.persistence.entitymodel.impl;

import java.util.Random;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.NamedQuery;

import br.com.lambdacore.model.EntityModelLong;

@MappedSuperclass
@NamedQuery(name = "findAll", query = "from EntityModelLong")
public abstract class ModelLongPersistence extends ModelPersistence<Long>
		implements EntityModelLong {

	private static final long serialVersionUID = 6939959881807319036L;

	@Id
	private Long id;

	public ModelLongPersistence() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setRandonId() {
		long id = new Random().nextLong();
		this.setId(id);
	}
}
